import time
import allure
from appium.webdriver import Remote
def add_img_2_report(driver:Remote,step_name,need_sleep=True):
    if need_sleep:
        time.sleep(2)
    allure.attach(driver.get_screenshot_as_png(),step_name+".png",allure.attachment_type.PNG)
#

# import time
#
# import allure
# from appium.webdriver import Remote
#
#
# def add_img_2_report(driver: Remote, step_name, need_sleep=True):
#     if need_sleep:
#         time.sleep(2)
#     allure.attach(driver.get_screenshot_as_png(), step_name + ".png", allure.attachment_type.PNG)
